package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.kefu.chat.model.ChatMenuConfigPlan;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.context.annotation.Bean;

import javax.validation.constraints.NotEmpty;

@Data
public class ChatMenuConfigPlanUpdateVo extends AbstractUpdateVo<ChatMenuConfigPlan, String> {
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "公司id")
    private String tenantId;

    @ApiModelProperty(value = "方案名称")
    private String planName;

    @ApiModelProperty(value = "方案备注")
    private String planRemark;

    @ApiModelProperty(name = "sortNo", value = "排序")
    private Integer sortNo;

    @ApiModelProperty(name = "menus", value = "快捷菜单列表")
    private String menus;

    @ApiModelProperty(name = "enableStatus", value = "是否启用 0=未启用，1=启用")
    private Integer enableStatus;

    @ApiModelProperty(value = "渠道id")
    private String channelId;

    @ApiModelProperty(value = "触发器id，暂时保留不用")
    private String triggerId;

    @ApiModelProperty(value = "进入标志 0=进线，1=进入机器人会话，2=进入人工会话")
    private Integer postCondition;

    @Override
    public ChatMenuConfigPlan convert() {
        KefuContext context = KefuContext.getKefuContext();
        ChatMenuConfigPlan info = BeanUtil.toBean(this, ChatMenuConfigPlan.class);
        info.setUpdateName(context.getUserName());
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;
    }
}
